
<!DOCTYPE html>
<html lang="en" >

<meta charset="UTF-8">
<title>留言簿</title>
<meta name="viewport" content="width=device-width, initial-scale=1">



<!--主要样式-->

<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" crossorigin="anonymous">




    <head>
        <meta charset="utf-8" />
        <title>留言板</title>
        <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" crossorigin="anonymous">
    </head>
    <body>

        <table class="table table-striped table-bordered table-hover table-condensed">
            <thead>
                <tr class="danger">
                    <th>留言时间</th>
                    <th>留言者</th>
                    <th>标题</th>
                    <th>内容</th>
                </tr>
            </thead>
            <tbody>
                {% if messages %}
                    {% for message in messages %}
                        <tr class="{% cycle 'active' 'success' 'warning' 'info' %}">
                            <td>{{ message.publish|date:'Y-m-d H:i:s' }}</td>
                            <td>{{ message.username }}</td>
                            <td>{{ message.title }}</td>
                            <td>{{ message.content }}</td>
                        </tr>
                    {% endfor %}
                {% else %}
                    <tr>
                        <td colspan="4">无数据</td>
                    </tr>
                {% endif %}
            </tbody>
        </table>
        <a class="btn btn-xs btn-info" href="/guestbook/create/">去留言</a>
    </body>
</html>

</body>
</html>